package com.briup.cms.dao;

import com.briup.cms.bean.Notes;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @program: cms
 * @description:
 * @author: charles
 * @create: 2020-07-02 09:37
 **/

public interface NotesMapper {
    @Results(
            {
                    @Result(column = "user_id",property = "userId")
            }
    )

    @Select("select * from cms_notes")
    List<Notes> selectAll();

    @Insert("insert into cms_notes values(null,#{title},#{content},#{type},#{status},#{userId})")

    void insert(Notes notes);
    @Update("update cms_notes set title=#{title},content=#{content},type=#{type},status=#{status},user_id=#{userId} where id=#{id}")
    void update(Notes notes);
    @Delete("delete from cms_notes where id = #{id}")
    void deleteById(long id);
}


